import { VMCustomEntity } from "./VMCustomEntity";
import * as cc from "cc";
import { VMNodeEntity } from "./VMNodeEntity";
import { VMComponentEntity } from "./VMComponentEntity";
import { VMSpriteAttr } from "../VMEntity";

declare const CC_EDITOR;
declare const CC_DEV;

export class VMSpriteEntity extends VMComponentEntity{

    // @ts-ignore
    observerAttr: VMSpriteAttr;

    // protected async _updateValue(newValue,oldValue,watchPath){
    //     let val = await this.formatValue(newValue,oldValue,this.node,0,watchPath);
    //     this.component[this._property] = val;
        
    //     // this.watchNodes.forEach(async (node,index)=>{
    //     //     let state = await this.formatValue(newValue,oldValue,node,index,watchPath);
    //     //     let _property = this._property;

            
            
    //     //     node[_property] = state;
    //     // })
    // }

    async formatValue(newValue: any,oldValue: any,node: cc.Node,nodeIdx: number,watchPath: string){
      let val = await super.formatValue(newValue,oldValue,node,nodeIdx,watchPath)
      return val;
    }
    
    get _property(){
        return 'spriteFrame';
    }
}